<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!--评论 留言 评论回复 留言回复  -->

<script type="text/javascript">
	function msgDelete(msgId){
		if(confirm("您确定要删除这个消息吗？")){
			window.location="msgManage?action=delete&msgId="+msgId;
		}
	}
</script>
<div class="list-group">
	<div class="list-group-item">
		<img src="${pageContext.request.contextPath}/image/icon/list_icon.png" />
		<span>消息列表</span>
	</div>
	<div>
		<table class="table table-hover table-striped">
			<tr>
				<th>时间</th>
				<th>消息类别</th>
				<th>用户</th>
				<th>内容</th>
				<th>操作</th>
			</tr>
			<c:forEach var="msg" items="${msgs}">
				<tr>
					<th>『<fmt:formatDate value="${msg.pubDate}" type="date"
							pattern="yyyy-MM-dd" />』
					</th>
					<td>${msg.type}</td>
					<td>${msg.user.nickname}</td>
					<td>${msg.content}</td>
					<td>
						<%-- <button class="btn btn-mini btn-info" type="button"
							onclick="javascript:window.location='msgManage?action=hidden&msgId=${msg.id }'">隐藏</button>&nbsp; --%>
						<button class="btn btn-mini btn-danger" type="button"
							onclick="msgDelete(${msg.id})">删除</button>
					</td>
				</tr>
			</c:forEach>
		</table>
	</div>
	<div align="center">
		<font color="red">${error}</font>
	</div>
</div>
